package com.example.bootmanager;

import com.example.bootmanager.apk.ApkCacheHelper;
import com.example.bootmanager.shell.ShellCommand;

import android.app.Application;

public class MyApplication extends Application {
	private static MyApplication APPLICATION;
	private ApkCacheHelper mApkCacheHelper;
	private ConfigHelper mConfigHelper;
	private ShellCommand mShellCommand;

	public static final MyApplication getInstance() {
		return APPLICATION;
	}

	public ApkCacheHelper getApkCacheHelper() {
		if (mApkCacheHelper == null)
			mApkCacheHelper = new ApkCacheHelper(this);
		return mApkCacheHelper;
	}

	public ConfigHelper getConfigHelper() {
		if (mConfigHelper == null)
			mConfigHelper = new ConfigHelper(this);
		return mConfigHelper;
	}

	public ShellCommand getShellCommand() {
		if (mShellCommand == null)
			mShellCommand = new ShellCommand();
		return mShellCommand;
	}

	public void onCreate() {
		super.onCreate();
		APPLICATION = this;
	}
}
